<template>
  <!-- 列表 -->
  <ContentWrap>
    <el-descriptions
    class="margin-top"
    :column="1"
    :size="size"
    border
  >
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          空气质量监测总数量
        </div>
      </template>
      {{ total }}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          空气质量监测良好数量
        </div>
      </template>
      {{ good }}
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          省会城市网格覆盖范围
        </div>
      </template>
      {{ capital }}%
    </el-descriptions-item>
    <el-descriptions-item>
      <template #label>
        <div class="cell-item">
          大城市网格覆盖范围
        </div>
      </template>
      {{ big }}%
    </el-descriptions-item>

  </el-descriptions>
  </ContentWrap>
</template>

<script setup lang="ts">
import type { ComponentSize } from 'element-plus'

const size = ref<ComponentSize>('default')
import { StatisticsApi } from '@/api/envir/statistics'


/** 网格 列表 */
defineOptions({ name: 'OtherAqi' })

// const message = useMessage() // 消息弹窗

const loading = ref(true) // 列表的加载中
const list = ref<any[]>([]) // 列表的数据

const total = ref(0) // 总条数
const good = ref(0) // 良好数量
const capital = ref(0) // 省会城市网格覆盖范围
const big = ref(0) // 大城市网格覆盖范围


/** 查询列表 */
const getList = async () => {
  loading.value = true
  try {
    const data = await Promise.all([StatisticsApi.total(),StatisticsApi.good(),StatisticsApi.capital(),StatisticsApi.big()]);
    total.value = data[0] as any
    good.value = data[1] as any
    capital.value = data[2] as any
    big.value = data[3] as any
  } finally {
    loading.value = false
  }
}
/** 初始化 **/
onMounted(() => {
  getList()
})
</script>